home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / gnu / glibc108.gz / glibc108 / glibc-1.08.1 / sysdeps / sparc / sparc8 / mul_1.S < prev    next >
Text File  |  1994-04-26  |  2KB  |  92 lines

  1. ! SPARC v8 __mpn_mul_1 -- Multiply a limb vector with a single limb and
  2. ! store the product in a second limb vector.
  3.  
  4. ! Copyright (C) 1992, 1994 Free Software Foundation, Inc.
  5.  
  6. ! This file is part of the GNU MP Library.
  7.  
  8. ! The GNU MP Library is free software; you can redistribute it and/or modify
  9. ! it under the terms of the GNU Library General Public License as published by
  10. ! the Free Software Foundation; either version 2 of the License, or (at your
  11. ! option) any later version.
  12.  
  13. ! The GNU MP Library is distributed in the hope that it will be useful, but
  14. ! WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
  15. ! or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
  16. ! License for more details.
  17.  
  18. ! You should have received a copy of the GNU Library General Public License
  19. ! along with the GNU MP Library; see the file COPYING.LIB.  If not, write to
  20. ! the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  21.  
  22.  
  23. ! INPUT PARAMETERS
  24. ! res_ptr    o0
  25. ! s1_ptr    o1
  26. ! size        o2
  27. ! s2_limb    o3
  28.  
  29. #include "sysdep.h"
  30.  
  31. .text
  32.     .align    8
  33.     .global    C_SYMBOL_NAME(__mpn_mul_1)
  34. C_SYMBOL_NAME(__mpn_mul_1):
  35.     sll    %o2,4,%g1
  36.     and    %g1,(4-1)<<4,%g1
  37.     sethi    %hi(LL),%g3
  38.     or    %g3,%lo(LL),%g3
  39.     jmp    %g3+%g1
  40.     ld    [%o1+0],%o4    ! 1
  41. LL:
  42. LL00:    add    %o0,-4,%o0
  43.     add    %o1,-4,%o1
  44.     b    Loop00        /* 4, 8, 12, ... */
  45.     orcc    %g0,%g0,%g2
  46. LL01:    b    Loop01        /* 1, 5, 9, ... */
  47.     orcc    %g0,%g0,%g2
  48.     nop
  49.     nop
  50. LL10:    add    %o0,-12,%o0    /* 2, 6, 10, ... */
  51.     add    %o1,4,%o1
  52.     b    Loop10
  53.     orcc    %g0,%g0,%g2
  54.     nop
  55. LL11:    add    %o0,-8,%o0    /* 3, 7, 11, ... */
  56.     add    %o1,-8,%o1
  57.     b    Loop11
  58.     orcc    %g0,%g0,%g2
  59.  
  60. Loop:    addcc    %g3,%g2,%g3    ! 1
  61.     ld    [%o1+4],%o4    ! 2
  62.     st    %g3,[%o0+0]    ! 1
  63.     rd    %y,%g2        ! 1
  64. Loop00:    umul    %o4,%o3,%g3    ! 2
  65.     addxcc    %g3,%g2,%g3    ! 2
  66.     ld    [%o1+8],%o4    ! 3
  67.     st    %g3,[%o0+4]    ! 2
  68.     rd    %y,%g2        ! 2
  69. Loop11:    umul    %o4,%o3,%g3    ! 3
  70.     addxcc    %g3,%g2,%g3    ! 3
  71.     ld    [%o1+12],%o4    ! 4
  72.     add    %o1,16,%o1
  73.     st    %g3,[%o0+8]    ! 3
  74.     rd    %y,%g2        ! 3
  75. Loop10:    umul    %o4,%o3,%g3    ! 4
  76.     addxcc    %g3,%g2,%g3    ! 4
  77.     ld    [%o1+0],%o4    ! 1
  78.     st    %g3,[%o0+12]    ! 4
  79.     add    %o0,16,%o0
  80.     rd    %y,%g2        ! 4
  81.     addx    %g0,%g2,%g2
  82. Loop01:    addcc    %o2,-4,%o2
  83.     bg    Loop
  84.     umul    %o4,%o3,%g3    ! 1
  85.  
  86.     addcc    %g3,%g2,%g3    ! 4
  87.     st    %g3,[%o0+0]    ! 4
  88.     rd    %y,%g2        ! 4
  89.  
  90.     retl
  91.     addx    %g0,%g2,%o0
  92.